<template>
	<view>
		<view>
			<u-card v-for="(item,index) in list" :key="index" :title="item.time" :sub-title="item.state==='1'?'待审核':''" @click="showDitail(item.id,item.type)">
				<view class="" slot="body">
					<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
						<view class="u-body-item-title u-line-2">{{item.title}}</view>
					</view>
				</view>
			</u-card>
		</view>
		<u-toast ref="uToast" />
		<u-empty v-if="emptyShow" text="没有更多消息需要处理了" mode="message"></u-empty>
	</view>
</template>

<script>

export default {

	data(){
		return{
			imgUrl:this.$http.config.uploadPath,
			list:[],
			emptyShow:false
		}
	},
	methods:{
		getList(){
			var that = this;
			this.$http.get("/clsx/list").then(res=>{
				let data = res.data.data;
				if(data&&data.length>0){
					this.emptyShow = false
					that.list = data;
					
				}else{
					this.emptyShow = true;
				}
			}).catch(err => {
				this.$refs.uToast.show({
					title: '请求失败！',
					type: 'error'
				}) 
			})
		},
		showDitail(id,type){
			uni.navigateTo({
				url:'/pages/views/fwqz/fwqz_detail?id='+id+'&type='+type,
			})
		}
	},
	onLoad() {
		this.getList();
		
	}
}
</script>

<style scoped lang="scss">
	
.u-card-wrap { 
	background-color: $u-bg-color;
	padding: 1px;
}

.u-body-item {
	font-size: 32rpx;
	color: #333;
	padding: 20rpx 10rpx;
}
	
.u-body-item image {
	width: 120rpx;
	flex: 0 0 120rpx;
	height: 120rpx;
	border-radius: 8rpx;
	margin-left: 12rpx;
}
</style>